CODAP-572: Improve accessibility of custom select dropdown menus#2436
CODAP-572: Improve accessibility of custom select dropdown menus#2436
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add aria-label to MenuButton describing axis orientation and current attribute. Add visible focus indicator and dropdown arrow affordance on axis labels. Scroll focused menu items into view for magnification/zoom users. Add keyboard navigation for collection submenus (ArrowRight opens, ArrowLeft/Escape closes). Handle ArrowRight at MenuList level since Chakra MenuItem with as="div" does not forward onKeyDown to user handlers. Add tests for aria-label, focus scroll, menu rendering, and item selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add aria-haspopup and aria-expanded to collection submenu items.
Add aria-hidden to RightArrow SVG and hidden MenuButton.
Add tabIndex={-1} to hidden MenuButton to remove from tab order.
Add fill="currentColor" fallback to arrow-right.svg.
Wrap focus() in act() to fix React test warning.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… SVG fill Wire onClick on collection items to immediate open handler instead of the 150ms-delayed hover handler, so Enter/Space opens submenus without delay. Change arrow.svg fill from hardcoded #0592af to currentColor for CSS inheritance and theming, consistent with arrow-right.svg. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2436 +/- ##
===========================================
- Coverage 85.53% 69.31% -16.23%
===========================================
Files 758 760 +2
Lines 42172 42275 +103
Branches 10049 10467 +418
===========================================
- Hits 36070 29301 -6769
- Misses 6090 12949 +6859
- Partials 12 25 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
codap-v3
|
||||||||||||||||||||||||||||
| Project |
codap-v3
|
| Branch Review |
CODAP-572-accessible-axis-dropdowns
|
| Run status |
|
| Run duration | 02m 05s |
| Commit |
|
| Committer | Kirk Swenson |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
4
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
Pull request overview
This PR improves accessibility and keyboard usability of the graph axis/legend attribute menus, including better screen reader labeling, focus visibility, and submenu navigation.
Changes:
- Adds axis/legend-specific
aria-labels and decorativearia-hiddenattributes; scrolls focused menuitems into view. - Implements keyboard navigation for multi-collection submenus (ArrowRight opens; ArrowLeft/Escape closes + focus management) and adds a dropdown-arrow affordance + focus ring styling.
- Updates arrow SVGs to use
currentColor, adds unit tests for key accessibility behaviors, and fixes a MobX warning inuse-key-states.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| v3/src/utilities/translation/lang/en-US.json5 | Adds new localized strings for axis/legend aria-labels. |
| v3/src/hooks/use-key-states.ts | Wraps observable set mutations in runInAction to address MobX warnings. |
| v3/src/components/axis/components/axis-or-legend-attribute-menu.tsx | Adds aria-label computation, focus/scroll behavior, and keyboard submenu handling. |
| v3/src/components/axis/components/axis-or-legend-attribute-menu.test.tsx | Introduces tests for aria-label and focus/scroll behavior (with mocks). |
| v3/src/components/axis/components/axis-or-legend-attribute-menu.scss | Adds focus-visible outline and dropdown-arrow positioning/visibility. |
| v3/src/assets/icons/arrow.svg | Switches arrow fill to currentColor. |
| v3/src/assets/icons/arrow-right.svg | Switches arrow-right fill to currentColor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
v3/src/components/axis/components/axis-or-legend-attribute-menu.tsx
Outdated
Show resolved
Hide resolved
…menus
- Add aria-label to MenuButton ("Attribute [name], open menu") and inline
rename input ("Rename attribute [name]")
- Fix duplicate VisuallyHidden IDs by including attributeId
- Make VisuallyHidden drag instructions translatable
- Add dropdown arrow affordance on hover/focus-within (table and card)
- Add scrollIntoView on focused menu items for magnification users
- Override RDG selection color on header cells to standard focus color and
suppress button-level outline to avoid double focus highlight
- Add Up/Down arrow keyboard navigation between card attribute headers
via new onButtonKeyDown prop (analogous to Left/Right in table via RDG)
- Standardize card view focus outline color to #0957d0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract shared hooks (useMenuItemScrollIntoView, useSubmenuOpenOnArrowRight, useSubmenuCloseOnArrowLeft) from axis menu inline code and apply to all toolbar menus (Tables, Plugins, Tiles, Guide). Add aria-labels, scroll- into-view on menu item focus, and full keyboard submenu navigation (ArrowRight/ArrowLeft/Escape) to the Plugins hierarchical menu. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Apply useMenuItemScrollIntoView to all inspector MenuLists (case table, graph, map, slider) so focused items scroll into view during keyboard nav - Add aria-label to slider palette dropdown MenuButtons (direction, mode, scale type, date unit) so screen readers announce the setting name - Wrap decorative 🚧 emoji on unimplemented items with aria-hidden to prevent screen readers from announcing "construction" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address Copilot review suggestion to use consistent %@ placeholder notation in the axisAriaLabel translation comment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 27 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
v3/src/components/axis/components/axis-or-legend-attribute-menu.test.tsx
Show resolved
Hide resolved
v3/src/components/axis/components/axis-or-legend-attribute-menu.test.tsx
Outdated
Show resolved
Hide resolved
- Reset mock defaults in beforeEach for test independence - Add missing datePrecision translation key for slider aria-label - Remove unused containerDiv setup/teardown from tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Improves keyboard navigation, screen reader support, and focus visibility across all Chakra UI dropdown menus in CODAP, addressing Allyant audit item
#57.Graph axis/legend menus
aria-labelto menu buttons describing orientation and current attributearia-haspopup/aria-expanded,aria-hiddenon decorative elementsCase table/card attribute header menus
aria-labelto attribute menu buttons and inline rename inputsToolbar button menus (Tables, Tiles, Guide, Plugins)
aria-labeland scroll-into-view on focus to all toolbar menusaria-haspopup/aria-expandedon group itemsInspector panel menus
aria-labelto slider palette dropdown MenuButtonsaria-hiddenspansShared hooks (new)
useMenuItemScrollIntoView— scrolls focused menu items into view (12 consumers)useSubmenuOpenOnArrowRight/useSubmenuCloseOnArrowLeft— keyboard submenu navigationOther
currentColorfor CSS inheritanceuse-key-states.tsdatePrecisiontranslation keyFixes CODAP-572
Test plan
🤖 Generated with Claude Code